package org.ljy.transdemo.controller;

import lombok.extern.slf4j.Slf4j;
import org.ljy.transdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/trans")
@RestController
public class TransController {

    @Autowired
    private UserService userService;
    @RequestMapping("/registry")
    public Boolean registry(String name,String password) {

        Integer result = userService.insert(name,password);
        log.info("影响的行数：result:{}",result);


        return true;
    }
}
